package com.service.Impl;

import java.util.ArrayList;
import java.util.List;

import com.service.CategoryService;
import org.apache.ibatis.session.SqlSession;

import com.dao.CategoryDAO;
import com.entity.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CategoryServiceImpl implements CategoryService {
	@Autowired
	private CategoryDAO categoryDAO;
	public List<Category> selectAll(){
		List<Category> category=categoryDAO.selectAll();

		return category;
	}
	@Override
	public Category selectByParent(Integer parentId) {

		Category category=categoryDAO.selectByParent(parentId);

		return category;
	}
	@Override
	public Category selectByCategoryId(Integer categoryId) {
		Category category=categoryDAO.selectByCategoryId(categoryId);
		return category;
	}
	@Override
	public List<Category> selectBySearch(String bookName) {
		List<Category> category=categoryDAO.selectBySearch(bookName);
		return category;
	}

}
